package com.ys.web.user.risk;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RiskService {
    @Autowired
    private RiskMapper riskMapper;

    public void saveRisk(Risk risk) {
        riskMapper.saveRisk(risk);
        RiskManager.addRisk(risk.getUserId());
    }

    public List<Risk> getRiskList(Risk risk) {
        return riskMapper.getRiskList(risk);
    }

    public int updateRisk(Risk risk) {
        RiskManager.delRisk(risk.getUserId());
        return riskMapper.updateRisk(risk);
    }

    public List<RiskListInfo> getRiskListInfo(RiskVo riskVo) {
        return riskMapper.getRiskListInfo(riskVo);
    }

    public int getRiskListCount(RiskVo riskVo) {
        return riskMapper.getRiskListCount(riskVo);
    }
}
